package com.sodaopen.study.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sodaopen.study.entity.Course;
import com.sodaopen.study.entity.User;
import com.sodaopen.study.mapper.UserMapper;
import com.sodaopen.study.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public User findUserByUsername(String username) {
		return userMapper.selectByUsername(username);
	}

	@Override
	public void updateProfiles(User user) {
		userMapper.updateProfiles(user);
	}

	@Override
	public void updatePassword(User user) {
		userMapper.updatePassword(user);
	}

	@Override
	public void updatePic(User user) {
		userMapper.updatePic(user);
	}

	@Override
	public void registerUser(User user) {
		userMapper.insertUser(user);
	}

	@Override
	public List<User> findByParam() {
		return userMapper.selectByParam();
	}

	@Override
	public void updateUserClazz(Integer userId, Integer clazzId) {
		userMapper.updateUserClazz(userId, clazzId);
	}

}
